package org.example.spring_ioc.component;

import org.example.spring_ioc.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

@Controller
public class UserComponent {
//    public void sayHi() {
//        System.out.println("Hi,UserComponent...");
//    }
    @Bean
    public UserInfo userInfo1() {
        return new UserInfo("zhangsan", 1);
    }
    @Bean
    public UserInfo userInfo2() {
        return new UserInfo("lisi", 2);
    }
    @Bean
    public UserInfo userInfo3() {
        return new UserInfo("wangwu", 3);
    }

}
